package com.lancoo.cvas.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.lancoo.cvas.entity.Course;
import com.lancoo.cvas.entity.Room;
import com.lancoo.cvas.entity.Segment;
import com.lancoo.cvas.pojo.response.digitization.BuildingInfo;
import com.lancoo.cvas.pojo.vo.Campus;
import com.lancoo.cvas.pojo.vo.RoomDto;
import com.lancoo.cvas.pojo.vo.RoomVo;
import com.lancoo.cvas.util.Result;

import java.util.List;

/**
 * 教室
 *
 * @author liufeng
 * @email 1037383243@qq.com
 * @date 2023-12-04 11:54:00
 */
public interface RoomService extends IService<Room> {


    /**
     * 同步教室
     *
     * @param taskId
     * @param schoolId
     * @param term
     * @param buildInfoList
     */
    void syncRooms(Integer taskId, String schoolId, String term, List<BuildingInfo> buildInfoList);


    /**
     * 获取校区
     *
     * @param taskId
     * @return
     */
    List<Campus> getCampusList(Integer taskId);


    /**
     * 获取教室
     *
     * @param taskId
     * @param schoolId
     * @param roomType
     * @param campusId
     * @param term
     * @return
     */
    List<Room> getRomList(Integer taskId, String schoolId, Integer roomType, String campusId, String term);


    /**
     * 设置教室
     *
     * @param taskId
     * @param classId
     * @param roomId
     * @param schoolId
     * @return
     */
    String setRoom(Integer taskId, String classId, Long roomId, String schoolId);


    /**
     * 获得课程列表
     *
     * @param taskId
     * @param majorId
     * @param gradeId
     * @return
     */
    List<Course> getCourseList(Integer taskId, String majorId, String gradeId);


    /**
     * 获取环节列表
     *
     * @param taskId
     * @param majorId
     * @param gradeId
     * @return
     */
    List<Segment> getSegmentList(Integer taskId, String majorId, String gradeId);

    /**
     * @param taskId:
     * @param schoolId:
     * @param term:
     * @Description: 获取教室树形结构
     * @Author: liufeng
     * @Date: 2023/12/6 15:11
     * @return:
     */
    List<RoomVo> getRoomTree(Integer taskId, String schoolId, String term, Integer module);

    List<Room> getBuildingList(Integer taskId, String schoolId, String term, String campusId, Integer module);

    List<Room> getRoomListByBuilding(Integer taskId, String campusId, Integer buildingId, String schoolId, String term);

    /**
     * 通过学校和学期获取教室
     * @param schoolId
     * @param term
     * @return
     */
    List<Room> selectRoomList(String schoolId, String term);


    /**
     * 获取未被选择的教室
     * @param taskId
     * @param schoolId
     * @param roomType
     * @param campusId
     * @param term
     * @return
     */
    List<Room> getOtherRoomList(Integer taskId, String schoolId, Integer roomType, String campusId, String term);


    /**
     * 自动分配教室
     * @param taskId
     * @return
     */
    Result getAutoDistributionsRoom(Integer taskId);

    /**
     * 获取其他学期教室
     * @param taskId
     * @param schoolId
     * @param roomType
     * @param campusId
     * @param term
     * @return
     */
    List<RoomDto> getOtherRoomListV2(Integer taskId, String schoolId, Integer roomType, String campusId, String term);

    /**
     * 设置行政班
     * @param taskId
     * @param classId
     * @param roomId
     * @param schoolId
     * @return
     */
    String setRoomV2(Integer taskId, String classId, Long roomId, String schoolId);


    /**
     * 获取拆班对应教室
     * @param taskId
     * @param subId
     * @return
     */
    List<Room> getSubRoomList(Integer taskId, String subId);


    /**
     * 清空分配的教室
     * @param taskId
     * @return
     */
    String cleanDistributionsRoom(Integer taskId);
}

